package com.ymatou.riskcontrol.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.riskcontrol.api.parameter.SingleVerifyBean;
import com.ymatou.riskcontrol.api.service.SingleVerifyCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;

/**
 * 风控单个订单验证接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_SingleVerify {
	private static SingleVerifyBean singleVerifyBean;
	private static SingleVerifyCall singleVerifyCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("风控单个订单验证接口");
	}

	@Before
	public void caseUp() {
		singleVerifyBean = new SingleVerifyBean();
		singleVerifyCall = new SingleVerifyCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(singleVerifyCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_SingleVerify_001() {
		Logger.start(true,"风控单个订单验证成功");
		try {
			singleVerifyBean.setOrderId(105304897);
			singleVerifyBean.setIp("192.168.1.1");
			singleVerifyBean.setIsPass(false);
			singleVerifyBean.setAuditor("test");
			singleVerifyCall.setData(singleVerifyBean);
			singleVerifyCall.callService();
			Logger.comment("风控单个订单验证 call:" + singleVerifyCall.getEntityString());
			Logger.comment("风控单个订单验证  response:" + singleVerifyCall.getReturnData());
			Logger.verifyEquals("1", singleVerifyCall.getResult(), "验证单个订单是处理否成功");
			// TODO 补全case代码
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}